package com.jshoperxms.controller.mall.backstage.base;

/**
 * Created by sdywcd on 16/5/27.
 * Des:后台搜索vo
 */
public class BasePageSearchModel {


    /**
     * 是否自定义搜索
     */
    private int isCustomSearch;

    private int recordsTotal;
    private int recordsFiltered;
    /**
     * 表格控件请求次数
     */
    private int draw;
    /**
     * 请求第几页
     */
    private int start;
    /**
     * 请求几条
     */
    private int length;

    /**
     * 计算当前页
     * @return
     */
    public int getCalCurrentPage(){
        int currentPage=1;
        if(this.getStart()!=0){
            currentPage=this.getStart()/this.getLength()==1?2:this.getStart()/this.getLength()+1;
        }
        return currentPage;
    }

    public int getRecordsTotal() {
        return recordsTotal;
    }

    public void setRecordsTotal(int recordsTotal) {
        this.recordsTotal = recordsTotal;
    }

    public int getRecordsFiltered() {
        return recordsFiltered;
    }

    public void setRecordsFiltered(int recordsFiltered) {
        this.recordsFiltered = recordsFiltered;
    }

    public int getDraw() {
        return draw;
    }

    public void setDraw(int draw) {
        this.draw = draw;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getIsCustomSearch() {
        return isCustomSearch;
    }

    public void setIsCustomSearch(int isCustomSearch) {
        this.isCustomSearch = isCustomSearch;
    }
}
